package kit.edu.lego.gruppe3.levels.endzone;

import kit.edu.lego.gruppe3.levels.LevelSolver;
import lejos.robotics.subsumption.Arbitrator;
import lejos.robotics.subsumption.Behavior;

public class EndzoneSolver implements LevelSolver{

	@Override
	public void start() {
		Behavior endZoneFinish = new EndZoneFinish();
		Behavior endMove = new EndZoneMovement();
		Behavior findRight = new FindRightWall();
		Behavior hitWall = new HitFrontWall();
		
		Behavior[] behaviors = {endMove, findRight, hitWall, endZoneFinish};
		Arbitrator arby = new Arbitrator(behaviors);
		arby.start();
	}
	
	@Override
	public String toString() {
		return "End zone";
	}
	
	private static boolean levelCleared = false;
	
	public static boolean isLevelCleared() {
		return levelCleared;
	}
	
	public static void setLevelCleared(boolean cleared){
		levelCleared = cleared;
	}

}
